package com.ruoyi.user.service;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.UserSignRecordMapper;
import com.ruoyi.user.domain.UserSignRecord;

/**
 * 用户签到Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-10
 */
@Service
public class UserSignRecordService {
    @Autowired
    private UserSignRecordMapper userSignRecordMapper;

    /**
     * 查询用户签到
     *
     * @param signId 用户签到主键
     * @return 用户签到
     */
    public UserSignRecord selectUserSignRecordBySignId(Long signId) {
        return userSignRecordMapper.selectUserSignRecordBySignId(signId);
    }

    /**
     * 查询用户签到列表
     *
     * @param userSignRecord 用户签到
     * @return 用户签到
     */
    public List<UserSignRecord> selectUserSignRecordList(UserSignRecord userSignRecord) {
        return userSignRecordMapper.selectUserSignRecordList(userSignRecord);
    }

    /**
     * 新增用户签到
     *
     * @param userSignRecord 用户签到
     * @return 结果
     */
    public int insertUserSignRecord(UserSignRecord userSignRecord) {
        userSignRecord.setCreateTime(DateUtils.getNowDate());
        return userSignRecordMapper.insertUserSignRecord(userSignRecord);
    }

    /**
     * 修改用户签到
     *
     * @param userSignRecord 用户签到
     * @return 结果
     */
    public int updateUserSignRecord(UserSignRecord userSignRecord) {
        return userSignRecordMapper.updateUserSignRecord(userSignRecord);
    }

    /**
     * 批量删除用户签到
     *
     * @param signIds 需要删除的用户签到主键
     * @return 结果
     */
    public int deleteUserSignRecordBySignIds(Long[] signIds) {
        return userSignRecordMapper.deleteUserSignRecordBySignIds(signIds);
    }

    /**
     * 删除用户签到信息
     *
     * @param signId 用户签到主键
     * @return 结果
     */
    public int deleteUserSignRecordBySignId(Long signId) {
        return userSignRecordMapper.deleteUserSignRecordBySignId(signId);
    }
}
